<!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>${config.siteName}后台系统</title>
    <link href="/assets/images/favicon.ico" rel="shortcut icon" type="image/x-icon">
    <link href="/assets/static/font-awesome-4.7.0/css/font-awesome.min.css" rel="stylesheet" type="text/css">
    <link href="/assets/static/bootstrap-3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <link href="/assets/css/jquery-confirm.min.css" rel="stylesheet">
    <link href="/assets/static/fancybox/jquery.fancybox.min.css" rel="stylesheet">
    <link href="/assets/static/nprogress/nprogress.css" rel="stylesheet">
    <link href="/assets/static/toastr/toastr.min.css" rel="stylesheet">
    <link href="/assets/static/icheck-1.x/skins/square/green.css" rel="stylesheet">
    <link href="/assets/static/bootstrap-table/bootstrap-table.min.css" rel="stylesheet">
    <link href="/assets/static/bootstrap-daterangepicker/daterangepicker.css" rel="stylesheet">
    <link href="/assets/static/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
    <link href="/assets/static/zTree_v3/css/metroStyle/metroStyle.css" rel="stylesheet">
	<link href="/assets/static/bootstrap-fs-modal/dist/css/fs-modal.min.css" rel="stylesheet">
    <link href="/assets/css/yyl.core.css" rel="stylesheet">
    <script src="/assets/js/jquery-1.11.1.min.js" type="text/javascript"></script>
	<script src="/assets/static/bootstrap-3.3.7/js/bootstrap.min.js" type="text/javascript"></script>
	<script src="/assets/static/jquery_lazyload/jquery.lazyload.min.js" type="text/javascript"></script>
	<script src="/assets/js/jquery-confirm.min.js" type="text/javascript"></script>
	<script src="/assets/static/fancybox/jquery.fancybox.min.js" type="text/javascript"></script>
	<script src="/assets/static/mustache/mustache.min.js" type="text/javascript"></script>
	<script src="/assets/static/js-xss/dist/xss.min.js" type="text/javascript"></script>
	<script src="/assets/static/nprogress/nprogress.js"></script>
	<script src="/assets/static/toastr/toastr.min.js"></script>
	
	<script src="/assets/static/bootstrap-fs-modal/dist/js/fs-modal.min.js"></script>
	<script src="/assets/js/validator.js"></script>
	<script src="/assets/js/ajaxfileupload.js"></script>
	<script src="/assets/js/jquery-form.js"></script>
	<script src="/assets/js/wangEditor.min.js" type="text/javascript"></script>
	<script src="/assets/js/yyl.tool.js"></script>
	<script src="/assets/js/yyl.upload-preview.js"></script>
	<script src="/assets/js/yyl.core.js"></script>
	<script src="/assets/js/yyl.table.js"></script>
	<script src="/assets/js/jQuery.print.js"></script>
    
     <style>
        .hbody {
            height:100%;
            margin:0;
            padding:0;
            color: #73879C;
		    background: #ffffff;
		    font-family: "Helvetica Neue", Roboto, Arial, "Droid Sans", sans-serif;
		    font-size: 13px;
		    font-weight: 400;
		    line-height: 1.471
        }
        .t_panel {
		    width: 100%;
		    height:100%;
		    padding: 0px 0px 0px 0px;
		    display: inline-block;
		    background: #fff;
		    border: 0px solid #E6E9ED;
		    overflow:hidden;
		    -webkit-column-break-inside: avoid;
		    -moz-column-break-inside: avoid;
		    column-break-inside: avoid;
		    opacity: 1;
		    transition: all .2s ease
		}
        .t_title {
            width:100%;
            height:4rem;
            line-height:4rem;
            position:absolute;
            z-index:5;
            top:0;
            text-align:center;
        }
        

        .t_content {
            width:100%;
            overflow:auto;
            top:8rem;
            position:absolute;
            z-index:10;
            bottom:4rem;
            padding: 0 5px 6px;
		    float: left;
		    clear: both;
		    margin-top: 5px;
        }
        .t_footer {
            height:4rem;
            line-height:4rem;
            width:100%;
            position:absolute;
            z-index:200;
            bottom:0;
            text-align:center;
        }
    </style> 
    
</head>
<body>
    <div class="clearfix"></div>
            <div class="x_panel" id="x_panel_id">
                <div class="x_title">
                    <h3 class="display-5 text-center">${child.bizChildrenType.evalName} &nbsp;&nbsp;&nbsp;  全人(个体化)发展评估记录表</h3>
                    <h4 class="display-6 text-center">${child.bizChildrenType.evalRemark}</h4>
                    <h5 class="display-6 text-justify">姓名：${child.childName }  &nbsp;
                    		生日：  ${(child.birthday)?string("yyyy年MM月dd日") } &nbsp;
                    		年龄：  ${child.age} &nbsp;                                      
                    		  性别：<#if child.sex == '0'>男<#elseif child.sex == '1'> 女<#elseif child.sex== '2'>秘密 <#else>未知</#if>      </h5>
                    <div class="clearfix"></div>
                </div>
                <div class="x_content">
                        <div class="row">
							<@childTag method="evalTemplate" childId="${child.id}" intEvaluation="${child.intEvaluation}">
					                <#if evalTemplate?? && evalTemplate?size gt 0>
					                    <#list evalTemplate as item>
					                    		${item.tabb?default('')}
	                                           	<tr ${item.attroftr?default('')} class="${item.trclasscss?default('text-left')}" style="${item.trstylecss?default('border:0px solid #000;')}">
												   <#if item.tds?? && item.tds?size gt 0>
			                                                 <#list item.tds as td>
			                                                 
			                                                 <#if td.std =="1">
			                                                  <td ${td.attr }>
			                                                  </#if>
			                                                  	<label class="${td.labelclasscss?default('')}" style="${td.labelstylecss?default('')}">
			                                                	 <#if td.inputtype?? && td.inputtype !="" >
			                                                		
			                                                     	<span class="required"> ${td.inputbeforeval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}</span>
			                                                     	<#if td.inputtype=="checkbox">
			                                                     	<span name="${td.inputtype }_#{td.id}" id ="${td.inputtype }_#{td.id}" class="fa fa-square-o fa-2x"></span>
			                                                     	<#else>
			                                                     	<${td.tag?default('input')} type="${td.inputtype }" style="${td.inputstylecss?default('')}" class="${td.inputclasscss?default('')}" name="${td.inputtype }_#{td.id}" id ="${td.inputtype }_#{td.id}"  ${td.attr } readonly="true"></${td.tag?default('input')}>
			                                                     	</#if>
			                                                     	 
			                                                     	<span class="required"> ${td.inputafterval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}</span>
			                                                     	
			                                                     <#else>
			                                                     ${td.inputbeforeval?default('&nbsp;&nbsp;&nbsp;&nbsp;')} ${td.context} ${td.inputafterval?default('&nbsp;&nbsp;&nbsp;&nbsp;')}
			                                                    
			                                                     </#if>
			                                                     </label>
			                                                     <#if td.etd =="1">
			                                                    </td>
			                                                    </#if>
			                                                </#list>
		                                               
		                                            <#else>
		                                            
		                                            </#if>
												</tr>
												${item.taba?default('')}  
					                    </#list>
					                </#if>
					            </@childTag>		
						</div>
                        
						<div class="row">
							<div class="col-md-4 col-sm-4 col-xs-4">
                                  <label class="control-label" for="select_trainer">负责训练者: <span class="required">*</span></label>
                                  <input type="text" style="border:0;border-bottom:1px solid black;background:;" name="select_trainer"  id="select_trainer" readonly="true"/>
                              </div>
                              <div class="col-md-4 col-sm-4 col-xs-4">
                                  <label class="control-label" for="select_advocate">咨询评估师: <span class="required">*</span></label>
                                  <input type="text" style="border:0;border-bottom:1px solid black;background:;" name="select_advocate"  id="select_advocate" readonly="true"/>
                              </div>
                              <div class="col-md-4 col-sm-4 col-xs-4">
                              		<label class="control-label" for="select_evaldate">评估日期: <span class="required">*</span></label>
		                            <input type="text"  style="border:0;border-bottom:1px solid black;background:;" id="select_evaldate" name="select_evaldate"  readonly="true"/>
		                        </div>
                              
                          </div>
                  
                        
		                
                        <div class="ln_solid"></div>
                     
                </div>
                
               
            </div>
 						<div class="x_footer">
                            <div class="col-md-12 col-sm-12 col-xs-12" style="text-align:center">
                                <button type="button" class="btn btn-success printBtn"><i class="fa fa-pencil"> 打印</i></button>
                                <button type="button" class="btn btn-success exportBtn"><i class="fa fa-long-arrow-down"> 导出</i></button>
                                <button type="button" class="btn btn-primary" onclick="javascript:window.opener=null;window.open('','_self');window.close();"><i class="fa fa-undo"> 关闭</i></button>
                            </div>
                        </div>  
	<script type="text/javascript">
      var appConfig = {
    	        qiniuPath: '${config.qiuniuBasePath}',
    	        qiniuImgStyle: '-pw',
    	        wwwPath: '${config.siteUrl}',
    	        staticPath: '${config.staticWebSite}'
     }
      var versionjson={"childId":${child.id},"version":${version}};
      $.ajax({
          type: "post",
          url: "/child/findEvalValue/" + JSON.stringify(versionjson),
          success: function (json) {
              $.alert.ajaxSuccess(json);
              var info = json.data;
              // 标签
              for(var i = 0, len = info.length; i < len ; i ++){
                  if(info[i].value=="on"){
                	  $("#"+info[i].htmlId).removeClass("fa fa-square-o fa-2x");
                	  $("#"+info[i].htmlId).addClass("fa fa-check-square-o fa-2x");
                  }else{
                	  $("#"+info[i].htmlId).val(info[i].value);
                	  
                  }
                  
              }
              
              $("#select_trainer").attr("value",'${trainer}');
              $("#select_advocate").attr("value",'${advocate}');
              $("#select_evaldate").attr("value",new Date('${evaldate}').format("yyyy-MM-dd"));
          },
          error: $.alert.ajaxError
      });
      
	// 点击打印
	 $(".printBtn").click(function () {
		 
		/*  var newstr = document.getElementById("x_panel_id").innerHTML;
		 var oldstr = document.body.innerHTML;
		 document.body.innerHTML = newstr;
		 window.print();
		 document.body.innerHTML = oldstr;
		 return false;  */
		 
		 $("#x_panel_id").print({
			    globalStyles:true,//是否包含父文档的样式，默认为true
			    mediaPrint:false,//是否包含media='print'的链接标签。会被globalStyles选项覆盖，默认为false
			    stylesheet:null,//外部样式表的URL地址，默认为null

			    noPrintSelector:".no-print",//不想打印的元素的jQuery选择器，默认为".no-print"
			    iframe:true,//是否使用一个iframe来替代打印表单的弹出窗口，true为在本页面进行打印，false就是说新开一个页面打印，默认为true
			    append:null,//将内容添加到打印内容的后面
			    prepend:null,//将内容添加到打印内容的前面，可以用来作为要打印内容
			    deferred:
			 $.Deferred()//回调函数
			});
		 
	 });
	
	//点击导出pdf
	 $(".exportBtn").click(function () {
		 var options={};
		 options.data={"childId":"${child.id}","version":"${version}","intEvaluation":"${child.intEvaluation}","trainerName":"${trainer}","advocateName":"${advocate}","evaldate":"${evaldate}","evalName":"${child.bizChildrenType.evalName}"};
		 options.url='/download_pdf/'+ JSON.stringify(options.data);
		 options.method="POST";
		 DownLoadFile(options);
	 });
	
	 /*===================下载文件
	  * options:{
	  * url:'',  //下载地址
	  * data:{name:value}, //要发送的数据
	  * method:'post'
	  * }
	  */
	 var DownLoadFile = function (options) {
	     var config = $.extend(true, { method: 'post' }, options);
	     var $iframe = $('<iframe id="down-file-iframe" />');
	     var $form = $('<form target="down-file-iframe" method="' + config.method + '" />');
	     $form.attr('action', config.url);
	     for (var key in config.data) {
	         $form.append('<input type="hidden" name="' + key + '" value="' + config.data[key] + '" />');
	     }
	     $iframe.append($form);
	     $(document.body).append($iframe);
	     $form[0].submit();
	     $iframe.remove();
	 }
	
</script>

    </body>
</html>